﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.ComponentModel;

namespace Business.Compta
{
    public class OldComptaLineSup
    {
        private int id;
        private int idLine, _idLine;
        private int idAccount, _idAccount;
        private int idUser, _idUser;
        private int idCategory, _idCategory;
        private double amount, _amount;
        private string comment, _comment;

        public int Id
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }
        public int IdLine
        {
            get
            {
                return this.idLine;
            }
            set
            {
                this.idLine = value;
            }
        }
        public int IdAccount
        {
            get
            {
                return this.idAccount;
            }
            set
            {
                this.idAccount = value;
            }
        }
        public int IdUser
        {
            get
            {
                return this.idUser;
            }
            set
            {
                this.idUser = value;
            }
        }
        public int IdCategory
        {
            get
            {
                return this.idCategory;
            }
            set
            {
                this.idCategory = value;
            }
        }
        public double Amount
        {
            get
            {
                return this.amount;
            }
            set
            {
                this.amount = value;
            }
        }
        public string Comment
        {
            get
            {
                return this.comment;
            }
            set
            {
                this.comment = value;
            }
        }

        public OldComptaLineSup()
        {
            this.id = -1;
        }

        public OldComptaLineSup(int _id, int _idLine, int _idAccount, int _idUser, int _idCategory, double _amount, string _comment)
        {
            this.id = _id;
            this.idLine = _idLine;
            this.idAccount = _idAccount;
            this.idUser = _idUser;
            this.idCategory = _idCategory;
            this.amount = _amount;
            this.comment = _comment;
            this._idLine = _idLine;
            this._idAccount = _idAccount;
            this._idUser = _idUser;
            this._idCategory = _idCategory;
            this._amount = _amount;
            this._comment = _comment;
        }



        public void commit()
        {
            this._idLine = this.idLine;
            this._idAccount = this.idAccount;
            this._idUser = this.idUser;
            this._idCategory = this.idCategory;
            this._amount = this.amount;
            this._comment = this.comment;
        }

        public void reject()
        {
            this.idLine = this._idLine;
            this.idAccount = this._idAccount;
            this.idUser = this._idUser;
            this.idCategory = this._idCategory;
            this.amount = this._amount;
            this.comment = this._comment;
        }
    }

    public class ManageoNotifyPropertyChanged : INotifyPropertyChanged
    {

        public event PropertyChangedEventHandler PropertyChanged;
        event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged
        {
            add
            {
                PropertyChanged += value;
            }

            remove
            {
                PropertyChanged -= value;
            }
        }

        protected void onPropertyChanged(string PropertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(PropertyName));
        }
    }
}
